function [Result] = Ddavid_MLR_GL_cross_validation(SampledDataTraining, UnSampledDataTraining, SampledOnlyTrueLabelTraining, C, eta, NFold, Msg)

[TrainingDataSampler] = Ddavid_cross_validation_training_testing(SampledDataTraining, NFold);

Result.HammingLoss = 0.0;
Result.RankingLoss = 0.0;
Result.OneError = 0.0;
Result.Coverage = 0.0;
Result.Average_Precision = 0.0;

for FoldNumber = 1:NFold
    if(Msg == true)
        disp(['Ddavid_MLR_GL_cross_validation Fold ' num2str(FoldNumber)]);
    end
    
    [TempAllDataTraining2, AllDataTesting2, TempTrueLabelTraining2, TrueLabelTesting2] = Ddavid_pick_up_fold(SampledDataTraining, SampledOnlyTrueLabelTraining, TrainingDataSampler, FoldNumber);
    AllDataTraining2 = [TempAllDataTraining2; UnSampledDataTraining];
    TrueLabelTraining2 = [TempTrueLabelTraining2; ones(size(UnSampledDataTraining, 1), size(SampledOnlyTrueLabelTraining, 2)) * (-1)];
    N = size(AllDataTraining2, 1);
    
    d = Ddavid_chi2_d(AllDataTraining2, AllDataTraining2);
    Sigma = sum(sum(d, 1), 2) / (N * (N - 1) / 2);
    kernel_training = Ddavid_exp_chi2(AllDataTraining2, AllDataTraining2, Sigma);
    kernel_testing = Ddavid_exp_chi2(AllDataTraining2, AllDataTesting2, Sigma);

    [alphas, it_time] = bucak_cvpr11(kernel_training, TrueLabelTraining2, C, eta, false);
    [ResultTemp.Score] = calc_func_output(TrueLabelTraining2, alphas, kernel_testing);

    ResultTemp.Pre = ResultTemp.Score;
    ResultTemp.Pre(ResultTemp.Pre > 0) = 1;
    ResultTemp.Pre(ResultTemp.Pre <= 0) = -1;

    ResultTemp.HammingLoss = Hamming_loss(ResultTemp.Pre', TrueLabelTesting2');
    ResultTemp.RankingLoss = Ranking_loss(ResultTemp.Pre', TrueLabelTesting2');
    ResultTemp.OneError = One_error(ResultTemp.Pre', TrueLabelTesting2');
    ResultTemp.Coverage = coverage(ResultTemp.Pre', TrueLabelTesting2');
    ResultTemp.Average_Precision = Average_precision(ResultTemp.Pre', TrueLabelTesting2');

    if(Msg == true)
        disp(['HammingLoss = ' num2str(ResultTemp.HammingLoss)]);
        disp(['RankingLoss = ' num2str(ResultTemp.RankingLoss)]);
        disp(['OneError = ' num2str(ResultTemp.OneError)]);
        disp(['Coverage = ' num2str(ResultTemp.Coverage)]);
        disp(['Average_Precision = ' num2str(ResultTemp.Average_Precision)]);
    end
    
    Result.HammingLoss = Result.HammingLoss + ResultTemp.HammingLoss;
    Result.RankingLoss = Result.RankingLoss + ResultTemp.RankingLoss;
    Result.OneError = Result.OneError + ResultTemp.OneError;
    Result.Coverage = Result.Coverage + ResultTemp.Coverage;
    Result.Average_Precision = Result.Average_Precision + ResultTemp.Average_Precision;
end

Result.HammingLoss = Result.HammingLoss / NFold;
Result.RankingLoss = Result.RankingLoss / NFold;
Result.OneError = Result.OneError / NFold;
Result.Coverage = Result.Coverage / NFold;
Result.Average_Precision = Result.Average_Precision / NFold;
